Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for selecting simple (default) or full type names #26

Merged
merged 1 commit into from
Apr 14, 2015

Conversation

robert-iddink
Copy link

No description provided.

@buildhive
Copy link

Netcetera » valdr-bean-validation #100 SUCCESS
This pull request looks good
(what's this?)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 90.67% when pulling 6f964e7 on Arzie:master into c9fc45c on netceteragroup:master.

@marcelstoer
Copy link
Collaborator

@philippd what's your take on this? We've been using the class' simple name on purpose because we want to "encourage" people to use unique names for their entities/model classes. One shouldn't have two Person model classes in two different packages.

@robert-iddink
Copy link
Author

@marcelstoer How about two Name classes in different packages? That's our use case at the moment ;-).

@philippd
Copy link
Collaborator

This should work fine. The only thing to keep in mind is to always use the fully qualified class name in the valdr-type directive when this option is enabled.

@marcelstoer
Copy link
Collaborator

This should work fine.

Yes, it will work. I'm just not sure whether we should offer that option at all? IIRC we've been discussing this before during the initial implementation. It's irrelevant whether your model class is a Person or a Name (even though it's semantically more generic) it's IMO still bad practice.

My point essentially is about how restrictive the project should be in enforcing what we consider good or bad practice.

@philippd
Copy link
Collaborator

Yes we discussed it back then and decided to use the simple name to encourage best practices and keep the names in the markup short.

IMO it's fine to add the option as long as the default is to use the simple name. This way we still encourage to use what we consider good practice, but also support cases where someone might not be able to avoid having two classes with the same name (3rd party code).

@robert-iddink
Copy link
Author

I could add a comment to make it explicit that the simple name is the suggested usage, would that help?

marcelstoer added a commit that referenced this pull request Apr 14, 2015
Add support for selecting simple (default) or full type names
@marcelstoer marcelstoer merged commit f944d20 into netceteragroup:master Apr 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants